#include "skyView.h"
#include "camera/fixed_point_camera.h"

const Point SkyView::viewerPos = Point(0,30,30);

SkyView::SkyView(const Rectangle& viewport,SceneModel& model)
	: SceneView(viewport,model){
	Point hcenter = model.getHelicopter().getDimensions().center();

	float fovUp  = 80.0f;
	float aspect = ((GLfloat) viewport.width()/(GLfloat) viewport.height());
	float zNear  = 0.1f;
	float zFar   = 1600.0f;
	camera = new FixedPointCamera(	hcenter,hcenter+viewerPos,Point(0,0,1),
									fovUp,aspect,zNear,zFar);
}

SkyView::~SkyView(){

}

void SkyView::setEnv(){
	glViewport ((GLint) viewport.x1,(GLint) viewport.y1, (GLsizei) viewport.width(), (GLsizei) viewport.height());
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
